import { dsqRequest } from '../index';
import { IAccountType, IResultType, ILoginDataType, IUserType } from './type';
enum LoginApi {
  AccoutLogin = '/login',
  UserInfo = '/users/',
  UserMenu = '/role/'
}

export function accountLoginRequest(account: IAccountType) {
  return dsqRequest.post<IResultType<ILoginDataType>>({
    url: LoginApi.AccoutLogin,
    data: account
  });
}
export function getUsersInfoRequest(id: number) {
  return dsqRequest.get<IResultType<IUserType>>({
    url: LoginApi.UserInfo + id
  });
}
export function getUsersMenuRequest(id: number) {
  return dsqRequest.get<IResultType>({
    url: LoginApi.UserMenu + id + '/menu'
  });
}
